package com.prj.ufdm.cloud.ms.core.enums.code;
/**
 * DESC: 个人证件类型（参考：住建部个人证件类型编码表）
 * @author 胡义振
 */
public enum CertificateTypeEnum {
	
	CERTIFICATE_TYPE_01("01","身份证"),
	CERTIFICATE_TYPE_02("02","军官证"),
	CERTIFICATE_TYPE_03("03","护照"),
	CERTIFICATE_TYPE_04("04","外国人永久居留证"),
	CERTIFICATE_TYPE_05("05","港澳台居民往来通行证(香港)"),
	CERTIFICATE_TYPE_06("06","港澳台居民往来通行证(澳门)"),
	CERTIFICATE_TYPE_07("07","台湾居民往来大陆通行证"),
	CERTIFICATE_TYPE_08("08","边民出入境通行证"),
	CERTIFICATE_TYPE_09("09","临时居民身份证"),
	CERTIFICATE_TYPE_10("10","户口本"),
	CERTIFICATE_TYPE_11("11","士兵证"),
	CERTIFICATE_TYPE_12("12","警官证"),
	CERTIFICATE_TYPE_13("13","外交人员证件"),
	CERTIFICATE_TYPE_14("14","机动车驾驶证"),
	CERTIFICATE_TYPE_99("99","其他");
	
	private String code;
	private String message;
	
	CertificateTypeEnum(String code,String message){
		this.code = code;
		this.message = message;
	}

	/**
	 * DESC: 根据值获取名称
	 * @param retCode
	 * @return
	 */
	public static String getRetMessage(String retCode){
		String rtnRetCode = "";
		for (CertificateTypeEnum codeGenerate : CertificateTypeEnum.values()) {
			if(codeGenerate.code.equals(retCode)){
				rtnRetCode = codeGenerate.message;
			}
	    }
		return rtnRetCode;
	}
	
	/**
	 * 
	 * DESC: 根据名称获取值
	 * @param retMessage
	 * @return
	 */
	public static String getRetValue(String retMessage){
		String rtnRetCode = "";
		for (CertificateTypeEnum codeGenerate : CertificateTypeEnum.values()) {
			if(codeGenerate.message.equals(retMessage)){
				rtnRetCode = codeGenerate.code;
			}
	    }
		return rtnRetCode;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
}
